/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package graphic;

import graphic.entites.Class;
import include.fxml.SlyumFX;
import javafx.geometry.Dimension2D;
import javafx.geometry.Point2D;

/**
 *
 * @author David
 */
public class ClassFactory extends Factory {

  public static ClassFactory instance;
  
  public static ClassFactory getInstance() {
    if (instance == null)
    
      instance = new ClassFactory();
    
    return instance;
  }
  
  @Override
  public boolean create(){
    UML.Class modelClass = new UML.Class(UML.Class.getNextClassName());
    SlyumFX.getInstance().getCurrentDiagramTab().getDiagramPane().getChildren().add(new Class(modelClass, new Point2D(getTranslateX(), getTranslateY())));
    return true;
  }
  
  private ClassFactory() {
    super();
    getChildren().add(Class.createBorder(new Dimension2D(150.0, 80.0)));
  }
  
}
